<%@ page import="service.serviceimpl.ServiceUserImpl" %>
<%@ page import="entity.Userinfo" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    ServiceUserImpl serviceUser = new ServiceUserImpl();
    int id = Integer.parseInt(request.getParameter("id"));
    List<Userinfo> userinfos = serviceUser.executeQuery("select * from userinfo where id=?", id);
%>
<form method="get" action="controller.jsp">
    <input type="hidden" name="op" value="update2">
    <input type="hidden" name="id" value="<%=id%>">
    <table border="4">
        <tr>
            <th>姓名 <input type="text" name="name" value="<%=userinfos.get(0).getName()%>"></th>
        </tr>
        <tr>
            <th>男<input type="radio"  <%=userinfos.get(0).getSex()==1?"checked":""%> value="1" name="sex">
                女<input type="radio" <%=userinfos.get(0).getSex()==2?"checked":""%> value="2" name="sex">
            </th>
        </tr>
        <tr>
            <th>爱好 <%--k-v--%>
                <select name="dept">
                    <option value="总裁"  <%=userinfos.get(0).getDept() .equals("总裁")?"SELECTED":""%>>总裁</option>
                    <option value="经理" <%=userinfos.get(0).getDept() .equals("经理")?"SELECTED":""%>>经理</option>
                    <option value="前台" <%=userinfos.get(0).getDept() .equals("前台")?"SELECTED":""%>>前台</option>
                </select>
            </th>
        </tr>
    </table>
    <input type="submit" value="提交">
</form>
</body>
</html>
